<?php
 
 

$arrJoke = array(
    "ID" 			 => "ID" 			,
    "TITLE" 		 => "TITLE" 		,
	"CATEGORY_ID"    => "CATEGORY"   ,
	"CREATED" 	     => "CREATED" 	    ,
	"USER_ID" 	     => "USER_ID" 	    ,
	"LINK" 		     => "LINK" 		    ,		
);
 

    function buildObject($table,$result) {
		switch($table){
	
			case JOKE: $product = getJoke($result);break;
			case USER: $product = getUser($result);break;
	
		}
		
		return $product;
    }

	function getJoke($result){					
		$product = array();
        $product["ID"] 			= $result["ID"];
        $product["TITLE"] 		= $result["TITLE"];
		$product["DESCRIPTION"] = $result["DESCRIPTION"];
        $product["CATEGORY"] 	= $result["CATEGORY"];
		$product["CREATED"] 	= $result["CREATED"];
		$product["LANGUAGE"] 	= $result["LANGUAGE"];
		$product["USER_ID"] 	= $result["USER_ID"];
		$product["LINKFTP"] 	= $result["LINKFTP"];
		$product["LINKYT"] 		= $result["LINKYT"];
		$product["POINTS"] 		= $result["POINTS"];
		$product["CLICKS"] 		= $result["CLICKS"];		
		
		return $product;
	}
	
	function getUser($result){					
		$product = array();
        $product["ID"] 			= $result["ID"];
        $product["NAME"] 		= $result["NAME"];								
		
		return $product;
	}


		function getColumnNames($table){
				
		$arrJoke = array(
		"ID" 			 => "ID" 			,
		"TITLE" 		 => "TITLE" 		,
		"CATEGORY"    	 => "CATEGORY"   ,
		"DESCRIPTION"    => "DESCRIPTION"   ,
		"LANGUAGE"       => "LANGUAGE"   ,
		"CREATED" 	     => "CREATED" 	    ,
		"USER_ID" 	     => "USER_ID" 	    ,
		"LINKYT" 		 => "LINKYT" 		    ,
		"LINKFTP" 		 => "LINKFTP" 		    ,
		"POINTS" 		 => "POINTS" 		    ,
		"CLICKS" 		 => "CLICKS" 		    ,		
		
		);
						
			switch($table){
			
				case JOKE: return $arrJoke;
			
			}
	}
 
?>